-- GENERATED SPELL FOR [Deathshadow Warlock] --


function spell0_22363(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_22363', 0, 1)
end

function spell1_22363(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(11962,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22363', 17000, 1)
end

function spell2_22363(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22363', 3000, 1)
end

function spell3_22363(pUnit, Event) --@Summon Twilight Ridge Imp,Self--
pUnit:FullCastSpellOnTarget(38980,pUnit)
pUnit:RegisterEvent('Sorts_22363', 609, 1)
end

function Sorts_22363(pUnit, Event)
local choix_sorts_22363 = math.random(0, 3)
if choix_sorts_22363 == 0 then
pUnit:RegisterEvent('spell0_22363', 1, 1)
end
if choix_sorts_22363 == 1 then
pUnit:RegisterEvent('spell1_22363', 1, 1)
end
if choix_sorts_22363 == 2 then
pUnit:RegisterEvent('spell2_22363', 1, 1)
end
if choix_sorts_22363 == 3 then
pUnit:RegisterEvent('spell3_22363', 1, 1)
end
end

function mob22363_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22363', math.random(1500, 3000), 1)
end

function mob22363_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22363_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22363_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22363, 1, 'mob22363_Action')
RegisterUnitEvent(22363, 2, 'mob22363_Leave')
RegisterUnitEvent(22363, 3, 'mob22363_Kill')
RegisterUnitEvent(22363, 4, 'mob22363_Die')
